//package com.xy.controller;
//
//import com.xy.entity.Book;
//import com.xy.entity.Press;
//import com.xy.service.PressService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
//@RestController
//public class PressController {
//    @Autowired
//    PressService pressService;
//
//    @GetMapping("/findallbooks")
//    public void findallbooks(){
//        List<Book> books = pressService.FindAllBookByPname("清华大学");
//        for (Book book1 : books) {
//            System.out.println(book1.getName());
//        }
//        System.out.println(books);
//    }
//
//    @GetMapping("/findbookinf")
//    public void findbookinf(){
//
//        Book book = pressService.FindBookinf("西游记");
//        System.out.println("id：" + book.getId());
//        System.out.println("书名：" + book.getName());
//        System.out.println("作者：" + book.getAuthor());
//        System.out.println("单价：" + book.getPrice());
//        System.out.println("出版社：" + book.getPress().getPname());
//    }
//
//    @GetMapping("/findbookinf_ex_pressinf")
//    public void findbookinf_ex_pressinf(){
//
//        Book book = pressService.FindBookinfexpname("西游记");
//        System.out.println("id：" + book.getId());
//        System.out.println("书名：" + book.getName());
//        System.out.println("作者：" + book.getAuthor());
//        System.out.println("单价：" + book.getPrice());
//    }
//
//    @GetMapping("/findallpress")
//    public void findallpress(){
//        List<Press> press = pressService.findAllPress();
//        for (Press press1 : press) {
//            System.out.println(press1.getPname());
//        }
//    }
//}
